#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H
#include <QLabel>
#include <QMouseEvent>
#include <QObject>


class ClickableLabel : public QLabel
{
    Q_OBJECT
public:
    ClickableLabel(QWidget* parent = nullptr) : QLabel(parent) {}

protected:
    void mousePressEvent(QMouseEvent* event) override
    {
        if (event->button() == Qt::LeftButton) {
            // 左键点击事件
            emit clicked();
        }

        // 将事件传递给父类处理
        QLabel::mousePressEvent(event);
    }

signals:
    void clicked();
};


#endif // CLICKABLELABEL_H
